package com.chushouya.common.constant;

import com.general.framework.core.enums.IEnum;

import java.util.Objects;

/**
 * 移动端登录方式定义
 */
public enum WebAppLoginTypeEnum implements IEnum<Integer> {

    ACCOUNT_LOGIN(1, "账号登录"),
    PHONE_LOGIN(2, "手机号登录"),
    WX_LOGIN(3, "微信登录");

    private Integer type;

    private String desc;

    WebAppLoginTypeEnum(Integer type, String desc) {
        this.type = type;
        this.desc = desc;
    }

    public static String getDesc(Integer status) {
        for (WebAppLoginTypeEnum thisEnum : WebAppLoginTypeEnum.values()) {
            if (Objects.equals(thisEnum.type, status)) {
                return thisEnum.desc;
            }
        }
        return "";
    }

    @Override
    public Integer value() {
        return this.type;
    }

    @Override
    public String named() {
        return this.desc;
    }
}
